function db(sql, callback) {
    const mysql = require('mysql');
    const conn = mysql.createConnection({
      host     : 'localhost',
      user     : 'root',
      password : '',
      database : 'bigevent'
    });

    conn.connect();
    conn.query(sql, callback);
    conn.end();
}


module.exports = db;
// db('select * from student', (err, result) => {
//     if(err) throw err;
//     console.log(result);
// });